const init = {
  contents:[]
}

export default function content(state=init,action){
  let newState = { ...state }
  const {type,payload} = action
  switch (type) {
    case 'addContent':
      newState.contents = [...newState.contents, payload]
      return newState
    case 'getContent':
      newState.contents = payload
      return newState
    default:
      return state
  }
}
